package com.cskaoyan.javase.oop2._1extends._10final._3variable._3static;

/**
 * 当使用字面值常量给全局常量显式赋值时,
 * 访问该全局常量
 * 不会触发该类的类加载,该类的静态代码块不会执行
 *
 * @since 11:38
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
       /* System.out.println(A.CONST);
        System.out.println(A.CONST2);
        System.out.println(A.CONST3);
        System.out.println(A.CONST4);*/
        // System.out.println(A.CONST5);
        System.out.println(A.CONST6);
    }
}

class A {
    static {
        System.out.println("A类进行类加载了!");
    }

    static final int CONST = 123;
    static final double CONST2 = 0.1;
    static final char CONST3 = 'a';
    static final String CONST4 = "abc";
    static final String CONST5 = new String("abc");
    static final Demo CONST6 = new Demo();
}
